<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			#box {background-color:#eee; }
　　                            #box p {margin-top: 20px;margin-bottom: 20px;}
		</style>
	</head>
	<body>
		<button id="btn">点击</button>
		<table style="table-layout: fixed;" width="50%" border="1" cellspacing="0" cellpadding="0">
			<tr>
				<td  width="500">1</td>
				<td>2</td>
				<td>3</td>
				<td>4</td>
			</tr>
			<tr>
				<td width="500">1</td>
				<td>2</td>
				<td>3</td>
				<td>4</td>
			</tr>
		</table>
		　
	　　<div id="box">
	　　       <p>p对象中的内容</p>
	　　</div>
	
	<script type="text/javascript">
     
	function myBrowser(){
    var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
    var isOpera = userAgent.indexOf("Opera") > -1;
    
    if (userAgent.indexOf("Firefox") > -1) {
        return "FF";
    } //判断是否Firefox浏览器
    if (userAgent.indexOf("Chrome") > -1){
  return "Chrome";
 }
   
}
//以下是调用上面的函数
var mb = myBrowser();

if ("FF" == mb) {
    alert("我是 Firefox");
}
if ("Chrome" == mb) {
    alert("我是 Chrome");
}

	</script>
	
	
	</body>
</html>
